{% extends 'base.html' %}

{% block title %}
{{ tag_name }}
{% endblock %}


{% block content %}
<div class="content-wrap">
    <div id="content" class="content">
        <section id="posts" class="posts-collapse">
            <span class="archive-move-on"></span>



                    <div class="collection-title">
            <h2 class="archive-year motion-element" id="archive-year-2017" style="opacity: 1; display: block; transform: translateX(0px);">{{ tag_name }}|标签</h2>
                    </div>

            {% for blog in tag_blogs.object_list %}

                <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article" style="opacity: 1; display: block; transform: translateY(0px);">
                    <header class="post-header">

                    <h1 class="post-title">
                        <a class="post-title-link" href="{% url 'blog_id' blog.id %}" itemprop="url">
                            <span itemprop="name">{{ blog.title }}</span>
                         </a>
                    </h1>

                    <div class="post-meta">
                        <time class="post-time" itemprop="dateCreated" datetime="2017-09-01T20:05:18+08:00" content="2017-09-01">
                    {{ blog.create_time|date:"m-d" }}
                        </time>
                      </div>

                    </header>
                  </article>
            {% endfor %}


        </section>



<!--分页展示-->
<nav class="pagination">
    <div class="pageturn">
        <ul class="pagelist">

            {% if tag_blogs.has_previous %}
                <li class="long"><a href="?{{ tag_blogs.previous_page_number.querystring }}">上一页</a></li>
            {% endif %}

            {% for page in tag_blogs.pages %}
            {% if page %}
                {% ifequal page tag_blogs.number %}
                    <li class="active"><a href="?{{ page.querystring }}">{{ page }}</a></li>
                {% else %}
                     <li><a href="?{{ page.querystring }}" class="page">{{ page }}</a></li>
                {% endifequal %}
            {% else %}
                <li class="none"><a href="">...</a></li>
            {% endif %}
            {% endfor %}
            {% if tag_blogs.has_next %}
                <li class="long"><a href="?{{ tag_blogs.next_page_number.querystring }}">下一页</a></li>
            {% endif %}

        </ul>
    </div>
</nav>



    </div>

</div>
{% endblock %}

